<template>
	<div class="inv-con">
		<div class="inv">
			<img :src="data.inviteBannerPic" alt="">
		</div>
    <!--商户-->
    <div class="merchantbox box_siz">
      <img class="marimg" :src="data.headImg" alt=""/>
      <p class="martxt">{{data.userName}}</p>
    </div>
		<div class="code" v-show="tinvitation">
			<img :src="data.qrCodeUrl" alt="">
			<span>转发连接<br>分享好友赚钱</span>
		</div>
		<!--<div class="footer">-->
			<!--<div class="btn">-->
				<!--保存图片-->
			<!--</div>-->
			<!--<div class="zf">转发好友</div>-->
		<!--</div>-->
	</div>
</template>

<script>
		export default {
			data() {
				return {
					activityId: '',
					userOpenId: '',
					data: '',
					tinvitation:true
				}
			},
			methods: {

			},
			mounted() {
				var that = this
				this.activityId = this.$route.params.activityId
				this.userOpenId = this.$route.params.openId
        console.log(this.activityId,this.userOpenId)
				this.$http({
					method: 'get',
					url: 'http://api.wangjianxin.top/invite?activityId=' + that.activityId + '&userOpenId=' + that.userOpenId
				}).then(function(res) {
					if(res.status === 200) {
						that.data = res.data
            if(res.data.isPay === 1){
              alert('请先购买才能分享赚钱～')
              that.tinvitation = false;
            }else{
              that.tinvitation = true;
            }
            console.log(that.data)
					}
				})
			}
		}
</script>
<style scoped>
	.inv-con {
		width: 100%;
		height: 100vh;
		overflow: hidden;
    position:relative;
	}

	.inv img {
		position: absolute;
		left: 0;
		right: 0;
		z-index: 1;
		width: 100vw;
		/*height: 8.54rem;*/
	}
  .code{
    font-size: .3rem;
    /*flex-direction: row;*/
    /*align-items: center;*/
    position: fixed;
    /*margin-top: 63vh;*/
    bottom: 1rem;
    z-index: 2;
    width: 200vw;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  .code img{
    width: 2rem;
    height: 2rem;
  }
  .code span{
    /*width: 3rem;*/
    line-height: .8rem;
  }
  /*商户*/

  .merchantbox {
    width: 7.5rem;
    /*height: 3.4rem;*/
    position: absolute;
    bottom:2.5rem;
    z-index:99;
    text-align: center;
    font-size: 0;
  }


  .marimg {
    width: 0.96rem;
    height: 0.96rem;
    /*display: block;*/
    border-radius: 50%;
  }

  .martxt {
    /*width:1rem;*/
    font-size: 0.22rem;
    font-family: PingFang-SC-Bold;
    font-weight: bold;
    color:#fff;
    line-height:0.5rem;

  }

  .marttext {
    color: rgba(107, 107, 107, 1);
  }
	/* btn */

	.footer {
		position: fixed;
		bottom: 0.5rem;
		z-index: 3;
		left:50%;
		margin-left:-2.815rem;
	}

	.btn {
		width: 5.63rem;
		height: 0.88rem;
		background: rgba(51, 54, 58, 1);
		border: 1px solid rgba(51, 54, 58, 1);
		letter-spacing: .1rem;
		font-size: .36rem;
		text-align: center;
		line-height: 0.88rem;
		font-family: PingFang-SC-Regular;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
	}

	.zf {
		font-size: 0.36rem;
		text-align: center;
		font-family: PingFang-SC-Regular;
		font-weight: 400;
		color: rgba(51, 54, 58, 1);
		line-height:1rem;
	}
</style>
